package br.com.statizo.financeiro.repository.impl;

import java.util.List;

import javax.persistence.Query;

import br.com.snoghert.persistence.repository.impl.SAbstractRepository;
import br.com.statizo.financeiro.entity.TipoPagamento;
import br.com.statizo.financeiro.repository.RepositorioTipoPagamento;

public class RepositorioTipoPagamentoImpl extends SAbstractRepository<TipoPagamento> implements RepositorioTipoPagamento{

	private static final long serialVersionUID = 1L;
	
	public RepositorioTipoPagamentoImpl() throws ClassNotFoundException {
		super();
	}

	@Override
	public List<TipoPagamento> getList(boolean somenteAtivos) {
		if(!somenteAtivos)
			return getList();
		Query query = entityManager.createQuery("From TipoPagamento Where inativo = false order by nome");
		return query.getResultList();
	}

}